import os
class MyFile:
    def __init__(self):
        self.dir = './static/upload/'

    #创建文件夹
    def file_mkdir(self,dirname):
        #判断是否存在
        path = self.dir+str(dirname)
        if not os.path.exists(path):
            #不存在创建
            os.mkdir(path)

    #获取某个文件夹下文件
    def list_dir(self,dirname):
         path = self.dir+str(dirname)
         list = os.listdir(path)
         return list


myfile = MyFile()
# myfile.file_mkdir(1)
# list = myfile.list_dir(1)
